package com.gexada.simplechat.data;

import java.util.Calendar;

public class InstantMessage {
	
	private long id;
	
	private String to;

	private String from;

	private String message;

	private Calendar created = Calendar.getInstance();

	public InstantMessage() {
	}

	public InstantMessage(Message msg) {
		this.id = msg.getId();
		this.to = msg.getTo();
		this.from = msg.getFrom();
		this.message = msg.getMsg();
		this.created = Calendar.getInstance();
		created.setTime(msg.getCreated().getTime());
	}
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Calendar getCreated() {
		return created;
	}

	public void setCreated(Calendar created) {
		this.created = created;
	}

	@Override
	public String toString() {
		return from + " send " + message + " to " + to + " at " + created.toString();
	}

}
